package com.longcai.piaojia.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/9/6.
 */
@HttpInlet(Conn.INDEX_SIGN_SHOW)
public class SignInGet extends BaseAsyGet<SignInGet.SignInEntity>{

    public String user_id;

    public SignInGet(AsyCallBack<SignInEntity> asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected SignInEntity parser(JSONObject object) throws Exception {

        if(object.optInt("code")==200){

            JSONObject jsonObject = object.optJSONObject("data");

            SignInEntity signInEntity = new SignInEntity();

            signInEntity.user_id = jsonObject.optString("user_id");
            signInEntity.integral = jsonObject.optString("integral");
            signInEntity.integral_month = jsonObject.optString("integral_month");
            signInEntity.integral_continuous = jsonObject.optString("integral_continuous");
            signInEntity.state = jsonObject.optString("state");

            return signInEntity;

        }

        TOAST = object.optString("message");

        return null;
    }

    public static class SignInEntity{

        public String user_id, integral, integral_month, integral_continuous, state;

    }

}
